<?php
/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: install.php 20324 2011-02-21 09:35:00Z zhengqingpeng $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$sql = <<<EOF
	CREATE TABLE IF NOT EXISTS `up6_files` (
		`f_id` 	char(32) NOT NULL,
		`f_pid` 	char(32) default '',		
		`f_pidRoot` char(32) default '',		
		`f_fdTask` tinyint(1) default '0',		
		`f_fdChild` tinyint(1) default '0',		
		`f_uid` 	int(11) default '0',
		`f_nameLoc` varchar(255) default '',	
		`f_nameSvr` varchar(255) default '',	
		`f_pathLoc` varchar(255) default '',	
		`f_pathSvr` varchar(255) default '',	
		`f_pathRel` varchar(255) default '',
		`f_md5` 	varchar(40) default '',	
		`f_lenLoc`	bigint(19) default '0',		
		`f_sizeLoc` 	varchar(10) default '0',	
		`f_pos` 		bigint(19) default '0',		
		`f_lenSvr` 	bigint(19) default '0',		
		`f_perSvr` 	varchar(7) default '0%',	
		`f_complete` 	tinyint(1) default '0',		
		`f_time` 		timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
		`f_deleted` 	tinyint(1) default '0',
		PRIMARY KEY  (`f_id`)
	  ) ENGINE=InnoDB;

	  CREATE TABLE IF NOT EXISTS `pre_up6_setting` (
		`id` int(10) unsigned NOT NULL auto_increment,
		`license` 	varchar(1000) NOT NULL,
		PRIMARY KEY (`id`)
	  ) ENGINE=InnoDB;

	  CREATE TABLE IF NOT EXISTS up6_folders (
		`f_id`              CHAR(32) NOT NULL,
		`f_nameLoc`         VARCHAR(255) DEFAULT '',
		`f_pid`             CHAR(32) DEFAULT '',
		`f_uid`             INT(11) DEFAULT '0',
		`f_lenLoc`          BIGINT(19) DEFAULT '0',
		`f_sizeLoc`         VARCHAR(50) DEFAULT '0',
		`f_pathLoc`         VARCHAR(255) DEFAULT '',
		`f_pathSvr`         VARCHAR(255) DEFAULT '',
		`f_pathRel`         VARCHAR(255) DEFAULT '',
		`f_folders`         INT(11) DEFAULT '0',
		`f_fileCount`       INT(11) DEFAULT '0',
		`f_filesComplete`   INT(11) DEFAULT '0',
		`f_complete`        TINYINT(1) DEFAULT '0',
		`f_deleted`         TINYINT(1) DEFAULT '0',
		`f_time` 			timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
		`f_pidRoot` 		char(32) default '',
		  PRIMARY KEY  (`f_id`)
		) ENGINE=InnoDB;
EOF;
runquery($sql);

$finish = TRUE;
?>
